The present invention relates to an image processing apparatus and method for encoding input image data and outputting encoded image data and, more particularly, to an image processing apparatus and method that can obtain a desired code length as a result of encoding.
In recent years, widespread color printers and the extended functions of DTP systems allow output of document images, character insertion with proper densities, and so on. With such techniques, a document image can be partially emphasized or intentionally made to be unobstrusive, and many kinds of information can be incorporated in a document image.
Meanwhile, a region segmentation technique has become popular. With this technique, constituting elements such as images (continuous gradation), figures, characters, and the like, and a format are defined, and a document image is described as a set of these constituting elements. As one of conventional region segmentation techniques, a method of quantizing a document image and segmenting the quantized image into regions is known. For example, a method of inputting a binary document image and determining regions is known. In this method, an input document image is binarized by comparing it with a pre-set threshold value to be divided into an image (continuous gradation) region, figure region, character region, and the like, and attributes that represent the contents are assigned to the divided regions, thus dividing the document image into a plurality of regions.
The constituting elements of document images that are segmented into a plurality of regions are increasingly sent nowadays as data exchanged via networks represented by the Internet that has become popular along with preparation of worldwide communication networks, and as SGML standardized in U.S.A. For this purpose, the document image or the individual constituting elements of the document image are required to be suitably encoded and transmitted or stored in a storage medium.
For example, the coding method is switched in units of constituting elements of an input document image so as to suitably encode the respective constituting elements of the document image and transmit or store them in a storage medium.
On the other hand, whether the input color document image is a binary or multi-valued image is determined, and the coding method for encoding the color document image is switched in accordance with the determination result, thus suitably encoding the color document image and transmitting or storing it in a storage medium.
However, of the conventional coding methods, since the method of encoding a document image in units of constituting elements uses a plurality of coding methods, code data with a code length that the user desired is hardly obtained as a whole.
On the other hand, in the method of determining whether the input color document image is a binary or multi-valued image, and encoding the color document image in accordance with the determination result, since the document image is encoded by a coding method corresponding to one of binary and multi-valued images, the quality of the document image cannot often be maintained.